package com.atom.module.captcha.config;

public enum CaptchaEnum {
    Math("math"), Char("char");

    public final String captcha;

    CaptchaEnum(String captcha) {
        this.captcha = captcha;
    }

    public static CaptchaEnum fromValue(String value) {
        if (value == null) throw new IllegalArgumentException("Value cannot be null");
        for (CaptchaEnum e : CaptchaEnum.values()) {
            if (e.captcha.equalsIgnoreCase(value)) {
                return e;
            }
        }
        return Math;
    }
}
